package com.smart.manager.member.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.enums.ChickenState;
import com.smart.manager.member.entities.views.MemberView;
import io.ebean.annotation.DbArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;


/**
 * 猪仔管理  -- 完整的猪
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class MemberMaterialChicken extends BaseLongModel {


    @ApiModelProperty("鸡蛋批次")
    private String code;

    @ApiModelProperty("猪仔代码")
    private String pigCode;

    @ApiModelProperty("所属玩家")
    @ManyToOne
    @JoinColumn(name = "member" , referencedColumnName = "id")
    private MemberView member;

    @ApiModelProperty("显示时间")
    private LocalDateTime displayTime;

    @ApiModelProperty("生成日期")
    private LocalDate generationTime;

    @ApiModelProperty("失败人员")
    @DbArray
    private List<Long> failMember;

    @ApiModelProperty("领取玩家")
    @ManyToOne
    @JoinColumn(name = "receive" , referencedColumnName = "id")
    private MemberView receive;

    @ApiModelProperty("领取时间")
    private LocalDateTime pickUpTime;

    @ApiModelProperty("鸡蛋状态")
    private ChickenState state;

}
